import { getItem, setItem } from '../../utils/storage'
import { DEFAULT_COLOR, MAIN_COLOR } from '../../constant'
import Variables from '../../styles/variables.module.scss'
export default {
  namespaced: true,
  state: () => ({
    // 主题色
    mainColor: getItem(MAIN_COLOR) || DEFAULT_COLOR,
    variables: Variables
  }),
  mutations: {
    setMainColor(state: any, newColor: string) {
      setItem(MAIN_COLOR, newColor)
      state.variables.menuBg = newColor
      state.mainColor = newColor
    }
  },
  actions: {}
}
